"""
Project Name : api_automation_framework
File Name : base64-demo.py
Author : lldhsds
Date : 2024/12/28 12:56
Description: /base64/{value}, 解码base64url编码的字符串。
"""

import requests

# /GET
# Decodes base64url-encoded string.
# parameters: value; string, (path); Default value : SFRUUEJJTiBpcyBhd2Vzb21l
# responses: 200(Decoded base64 content.)
def base64_demo(value: str = "SFRUUEJJTiBpcyBhd2Vzb21l") -> None:
    headers = {'content-type': 'text/html'}
    url = f"http://httpbin.org/base64/{value}"
    response = requests.get(url, headers=headers)
    print(response.status_code)
    print(response.text)


base64_demo()
base64_demo(value="aHR0cHM6Ly93d3cuYmFpZHUuY29t")
